###
### Makefile for GNU Interactive Tools
###

###
### Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
###
### This program is  free software; you can  redistribute it and/or modify
### it under the terms  of the GNU General Public  License as published by
### the  Free Software Foundation; either version  2,  or (at your option)
### any later version.
### 
### This program is distributed  in the hope that  it will be  useful, but
### WITHOUT    ANY  WARRANTY;  without   even   the  implied  warranty  of
### MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR   PURPOSE.  See the GNU
### General Public License for more details.
### 
### You should  have received a  copy of  the GNU  General Public  License
### along with   this  program; if   not,  write  to   the Free   Software
### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
###


PRODUCT		= "@PRODUCT@"
VERSION		= "@VERSION@"


srcdir		= @srcdir@
VPATH		= @srcdir@

prefix		= @prefix@
bindir		= $(prefix)/bin
libdir		= $(prefix)/lib/git
infodir		= $(prefix)/info
mandir		= $(prefix)/man/man1
termdir		= $(prefix)/lib/git/term

SHELL		= /bin/sh
TAR		= tar
GZIP		= gzip
BASENAME	= basename
HOST		= @HOST@
SUBDIRS		= src info man term


all:
	@(\
	    echo "Making $(PRODUCT) $(VERSION)...";\
	    echo "Configured for $(HOST)";\
	)
	(cd src && $(MAKE) $@)

installdirs:
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done

info:	FORCE-info
	@(\
	    echo "Making $(PRODUCT) $(VERSION) info documentation...";\
	    echo "Configured for $(HOST)";\
	)
	(cd info && $(MAKE) $@)

FORCE-info:

dvi:
	(cd info && $(MAKE) $@)

install: all install-only

install-only:
	@(\
	    echo "Installing $(PRODUCT) $(VERSION)...";\
	    echo "Configured for $(HOST)";\
	)
	$(MAKE) installdirs &&\
	\
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done
	@echo "Please see the README file for additional information"

install-strip:
	@(\
	    echo "Installing $(PRODUCT) $(VERSION)...";\
	    echo "Configured for $(HOST)";\
	)
	$(MAKE) installdirs &&\
	\
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done
	@echo "Please see the README file for additional information"

dep:
	(cd $(srcdir)/src && $(MAKE) $@)

distdone:
	cd $(srcdir) && dir=`pwd` && cd ..;\
	$(TAR) -cf - `$(BASENAME) $$dir` |\
	$(GZIP) -9c > `$(BASENAME) $$dir`.tar.gz;\
	\
	if test $$? != 0; then\
	    exit 1;\
	fi

dist:	dep tags info distclean distdone

uninstall:
	@echo "Uninstalling $(PRODUCT) $(VERSION)..."
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done
	@echo "Please remove the GIT entry from the Info dir file."

tags:
	cd $(srcdir)/src && $(MAKE) $@

etags:
	cd $(srcdir)/src && $(MAKE) $@

clean:
	-rm -f *.o *~ core* tutu* gogu*;\
	\
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done

mostlyclean: clean

distclean:
	-rm -f Makefile config.status config.log config.cache config.h;\
	rm -f version.h;\
	\
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done

realclean: distclean

# Tell version [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
